package cn.iocoder.yudao.module.dify.dal.mysql.translationtaskrecords;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.dify.dal.dataobject.translationtaskrecords.TranslationTaskRecordsDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.dify.controller.admin.translationtaskrecords.vo.*;

/**
 * dify翻译工作流任务记录 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface TranslationTaskRecordsMapper extends BaseMapperX<TranslationTaskRecordsDO> {

    default PageResult<TranslationTaskRecordsDO> selectPage(TranslationTaskRecordsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TranslationTaskRecordsDO>()
                .eqIfPresent(TranslationTaskRecordsDO::getFileId, reqVO.getFileId())
                .likeIfPresent(TranslationTaskRecordsDO::getOriginalName, reqVO.getOriginalName())
                .eqIfPresent(TranslationTaskRecordsDO::getExtension, reqVO.getExtension())
                .eqIfPresent(TranslationTaskRecordsDO::getMimeType, reqVO.getMimeType())
                .eqIfPresent(TranslationTaskRecordsDO::getDifyRequestId, reqVO.getDifyRequestId())
                .eqIfPresent(TranslationTaskRecordsDO::getDifyDownloadUrl, reqVO.getDifyDownloadUrl())
                .eqIfPresent(TranslationTaskRecordsDO::getDifyFileResponse, reqVO.getDifyFileResponse())
                .eqIfPresent(TranslationTaskRecordsDO::getDifyResponse, reqVO.getDifyResponse())
                .eqIfPresent(TranslationTaskRecordsDO::getMinioUrl, reqVO.getMinioUrl())
                .eqIfPresent(TranslationTaskRecordsDO::getProcessStatus, reqVO.getProcessStatus())
                .eqIfPresent(TranslationTaskRecordsDO::getRetryCount, reqVO.getRetryCount())
                .eqIfPresent(TranslationTaskRecordsDO::getReviewStatus, reqVO.getReviewStatus())
                .eqIfPresent(TranslationTaskRecordsDO::getReviewUrl, reqVO.getReviewUrl())
                .betweenIfPresent(TranslationTaskRecordsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TranslationTaskRecordsDO::getId));
    }

}